package xinSZ;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class NguessNumber {
 public static List<Integer>  generateAnswer(){
     ArrayList<Integer> ranlist=new ArrayList<>();
     int max=10,min=0,a=0;
     while (a<4){
         int b=0;
         int ran=(int) (Math.random()*(max-min)+min);
         for (int i = 0; i <ranlist.size() ; i++) {
             if (ran ==ranlist.get(i)){
             b=1;
                break;
            }
         }
         if (b==0){
             ranlist.add(ran);
             a++;
         }
     }
     return ranlist;
   }

   public static List<Integer> getPlayerInput(){
     Scanner sc =new Scanner(System.in);
     ArrayList<Integer> scLisr = new ArrayList<>();
       for (int i = 0; i <4 ; i++) {
           scLisr.add(sc.nextInt());
       }
    return scLisr;
   }


    public static void main(String[] args) {
        int a=0,b=0;
        Scanner sa = new Scanner(System.in);
        while (true){
            System.out.println("ĸ");
            List<Integer> ranList = generateAnswer();
            //System.out.println(ranList);
        while (true){
        List<Integer> scList = getPlayerInput();
            a=0;b=0;
        for (int i = 0; i <ranList.size() ; i++) {

            if (ranList.get(i)==scList.get(i)){
                    b++;
            }
            for (int j = 0; j <scList.size() ; j++) {
                if (ranList.get(i)==scList.get(j)){
                    a++;
                }
            }
        }
        if (a==4&&b==4){
            System.out.println("ɹ Yes/No");
            String m=sa.next();
            if (m.equals("Yes")){
                break;
            }else if (m.equals("No")){
                return;
            }
        }else {
            System.out.println(a+"\n"+"A\n"+b+"\nb");
        }

        }
 }
}
}